// var formElementList ={
//   appId:{
//     id:"AppId",
//     label:"AppId：",
//     className:'input-100',
//     element:'<label>AppId：</label><span><input type="text" id="appId" class="input-100"/></span>'
//   },
//   channelId:{
//     id:"channelId",
//     text:"ChannelId：",
//     label:'<label>AppId：</label><span><input type="text" id="appId" class="input-100"/></span>'
//   },

// }
var formElementList = {
  appId:
    '<label>AppId：</label><span><input type="text" id="appId" class="input-100"/></span>',
  channelId:
    '<label>AppId：</label><span><input type="text" id="appId" class="input-100"/></span>',
  appSecret:
    '<label>AppSecret：</label><span><input type="text" id="appSecret" class="input-260"/></span>',
  uid: '<label>uid：</label><span><input type="text" id="uid" class="input-150"/></span>',
  vid: '<label>vid（频道号）：</label><span><input type="text" id="vid" class="input-100"/></span>',
};

function getElementList() {
  var caseId = this.location.hash.substr(1);
  var type = caseId.split("-")[0];
  var elementList = [];
  switch (type) {
    case "live":
    case "chatroom":
      elementList = ["appId", "channelId", "appSecret"];
      break;
    case "liveplayer":
      elementList = ["uid", "vid"];
      break;
    case "vod":
      elementList = ["vid"];
      break;
    default:
      elementList = [];
      break;
  }
  return elementList;
}
function createFrom() {
  $('.exe-form').html('')
  var elementList = getElementList();
  var html =''
  var tipsText = elementList.join('、')
  for (var i = 0, len = elementList.length; i < len; i++) {
    html+=formElementList[elementList[i]]
  }
  html = '<div class="tips">请输入参数'+tipsText+'，再点击【运行】按钮预览效果</div>'+html+'<button id="tryexe" class="btn-c" type="button">运行</button>'
  $('.exe-form').prepend(html)
}
